<template>
  <div id="top">
    <div v-if="state">
      <span>欢迎</span><span>倾风</span><span><a href="#">联系人</a></span><span><a href="#">我的项目</a></span><span>|</span>
      <span><a href="#">个人中心</a></span><span>|</span><span>退出</span>
    </div>
    <div v-else>
      <span>欢迎</span><span><a href="/login">登入</a></span><span>|</span><span><a href="/register">注册</a></span>
    </div>
  </div>
</template>

<script>
export default {
  name: "top",
  data(){
    return {
      state: false,
      name:'',
    }
  },
  mounted(){
    let state = window.sessionStorage.getItem("state")
    if(state){
      this.state = true
      this.name = window.sessionStorage.getItem("name")
    }
  }
}
</script>

<style scoped>
*{
  color:white;
}
#top{
  height:40px;
  line-height: 40px;
  padding-left:40px;
  background-color:#303133;
}
a{
  text-decoration: none;
}
#top > div span{
  margin-right:10px;
  cursor: pointer;
}

</style>
